package framework.common.zanetwork;

/**
 * Created by wq on 2016/7/5.
 */
public class UeHttpUrl {

    // 远程环境
    public static String SERVER_IP = "http://47.91.148.42";
    public static String SERVER_PORT = null;
    // 本地环境
    public static String LOCALSERVER_IP = "192.168.199.107";
    public static String LOCALSERVER_PORT = "8080";
    // 生产环境
      public static String MODEL = "PRD";
    // 开发环境
	//public static String MODEL = "DEV";
    static {
        if (MODEL.equals("DEV")) {
            SERVER_IP = LOCALSERVER_IP;
            SERVER_PORT = LOCALSERVER_PORT;
        }
    }


    // 获取数据请求URL
    public static String BaseHttpUrl() {
        if (SERVER_PORT == null || "".equals(SERVER_PORT)) {
            return SERVER_IP + "/";
        } else {
            return "http://" + SERVER_IP + ":" + SERVER_PORT ;
        }
    }
    public static String getImgaes(){
        return BaseHttpUrl()+"images/";
    }

    /**
     * 根据token获取用户基本信息
     * @return
     */
    public static String userById(){
        return BaseHttpUrl()+"companyUser/userById";
    }
    /**
     * 更新用户信息
     * @return
     */
    public static String getCode(){
        return BaseHttpUrl()+"code.jpg";
    }
    /**
     * 登录
     * @return
     */
    public static String getLogin(){
        return BaseHttpUrl()+"u/login/";
    }
    /**
     * 注册
     * @return
     */
    public static String getResigt(){
        return BaseHttpUrl()+"u/new/";
    }
    /**
     * 字体获取
     * @return
     */
    public static String getFont(){
        return BaseHttpUrl()+"fonts/fonts.json";
    }
    /**
     * 获取配置信息
     * @return
     */
    public static String setting(){
        return BaseHttpUrl()+"conf/setting.json";
    }

    /**
     * 获取所有排行榜
     * @return
     */
    public static String gender(){
        return BaseHttpUrl()+"category/6/novel/106";
    }
    /**
     * 获取单一排行榜
     * @return
     */
    public static String getRankList(){
        return BaseHttpUrl()+"category/";
    }
    /**
     * 获取推荐
     * @return
     */
    public static String getReComment(String id){
        return BaseHttpUrl()+"novel/"+id+"/recommend";
    }
    /**
     * 只能获取正版源
     * @return
     */
    public static String getBookMixAToc(String id){
        return BaseHttpUrl()+"novel/"+id+"/mulu-urls";
    }
    /**
     * 获取章节
     * @return
     */
    public static String getChapterRead(){
        return BaseHttpUrl()+"site/";
    }
    public static String getHotWordList(){
        return BaseHttpUrl()+"conf/keywords.json";
    }
    /**
     * 获取分类
     * @return
     */
    public static String getCategoryList(){
        return BaseHttpUrl()+"category/";
    }
    /**
     * 书籍查询
     *
     * @param query
     * @return
     */
    public static String getSearchResultList(){
        return BaseHttpUrl()+"novel/search/";
    }
    /**
     * 书籍详情
     * @return
     */
    public static String getBookDetail(){
        return BaseHttpUrl()+"novel/";
    }
    public static String getRecommendBookList(String id){
        return BaseHttpUrl()+"novel/"+id+"/recommend";
    }
}
